package com.qs.product.client;

import com.qs.product.common.DecreaseStockInput;
import com.qs.product.common.ProductInfoOutput;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;

/**
 * @Desc:  定义调用接口
 * @author: jianfeng
 * @Time: 2019/9/17 16:26
 */
@FeignClient(name = "product")
public interface ProductClient {

    /**
    * @Desc:  获取商品列表（给订单服务用）
    * @author: jianfeng
    * @Time: 2019/9/18 14:46
    * @param productIdList
    * @return java.util.List<com.qs.product.common.ProductInfoOutput>
    */
    @PostMapping("/product/listForOrder")
    List<ProductInfoOutput> listForOrder(@RequestBody List<String> productIdList);

    /**
    * @Desc:  扣库存
    * @author: jianfeng
    * @Time: 2019/9/18 14:46
    * @param decreaseStockInputList
    * @return void
    */
    @PostMapping("/product/decreaseStock")
    void decreaseStock(@RequestBody List<DecreaseStockInput> decreaseStockInputList);

}
